<template>
  <div>
    <div class="header">

    <div class="nav-search">
      <img style="width:1180px;height:70px;border:none;" src="https://pic1.ajkimg.com/display/xinform/b47a47cd559b10e22a46919bb0d949c3/W0QQnZo.jpg.d91b722a53eba906235efdfc9356bb64.jpg">
      <a href="#" ><img src="/static/img/logo.svg" class="logo"></a>
      <div class="search-left">
        <ul class="ul-top">
          <li style="margin-left: 10px">首页</li>
          <span class="span-line"></span>
          <li>新房</li>
          <span class="span-line"></span>
          <li>二手房</li>
          <span class="span-line"></span>
          <li>租房</li>
          <span class="span-line"></span>
          <li>商品写字楼</li>
          <span class="span-line"></span>
          <li>海外地产</li>
          <span class="span-line"></span>
          <li>贷款</li>
          <span class="span-line"></span>
          <li>回答</li>
        </ul>
      </div>
      <div class="search-right">
        <ul class="ul-top">
          <li>
            <span>用户登录</span>
            <span class="login-logo"></span>          </li>
          <li><span class="span-line"></span>
            <a href="#" style="color: #666">
            <span class="glyphicon glyphicon-user" style="margin-right: 3px"></span>用户登录
            </a>
          </li>
          <li>
            <span style="margin-left: 10px;">注册</span>
          </li>
          <li>
            <a href="#" style="color: #666">
            <span class="glyphicon glyphicon-heart" style="margin-right: 3px;"></span>收藏夹

            </a>
            <span class="span-line"></span>
          </li>
        </ul> 
      </div>
    </div>
    <div class="nav-content">
      <ul class="content-ul">
        <li>安居客</li>
        <li>></li>
        <li>楼盘</li>
        <li>></li>
        <li>楼盘</li>
        <li>></li>
        <li>广汇 东湖城</li>
      </ul>
      <div class="search" style="float: right;">
        <div class="input-group">
            <input type="text" class="form-control" placeholder="Recipient's username" aria-describedby="basic-addon2">
            <span class="input-group-addon" id="basic-addon2">搜索</span>
          </div>
      </div>
    </div>
    <div class="nav-bottom">
      <ul class="bottom-ul">
        <a href="#"><li class="active-li">楼盘首页</li></a>
        <a href="#"><li>楼盘详情</li></a>
        <a href="#"><li>楼盘相册</li></a>
        <a href="#"><li>楼盘动态</li></a>
        <a href="#"><li>楼盘户型</li></a>
        <a href="#"><li>用户点评</li></a>
        <a href="#"><li>回答</li></a>
        <a href="#"><li>楼盘评测</li></a>
        <a href="#"><li>周边配套</li></a>
        <a href="#"><li>楼盘房源</li></a>
      </ul>
    </div>
  </div>

  <div class="sort-tab" >
    <a id="all_loupan" class="highlight nomargin" href="https://gg.fang.anjuke.com/loupan/all/">全部楼盘</a>
        <a id="discount_loupan" class="" href="https://gg.fang.anjuke.com/loupan/all/b9997/" rel="nofollow"><i class="iconfont lp-tab-icon"></i>优惠楼盘</a>
   </div>

    <div class="sort-condi">
        <div class="condition">
            <a class="light" href=""><span>默认排序</span></a>
            <a class="" href="https://gg.fang.anjuke.com/loupan/all/s2/" rel="nofollow"><span>价格</span><i class="list-ico defult-down"></i></a>
            <a class="" href="https://gg.fang.anjuke.com/loupan/all/s6/" rel="nofollow"><span>开盘时间</span><i class="list-ico defult-down"></i></a>
        </div>
        <span class="result">
            共有<em>101</em>个符合要求的<a target="_blank" class="" href="https://gg.fang.anjuke.com/loupan/" style="color: #f60">贵港楼盘</a>
        </span>
    </div>
    <cmpContent v-for="house in houseData" :key="house.ID" :house="house"/>
  </div>
</template>
<script type="text/javascript">
import cmpContent from '@/components/cmp-content'
  export default{//总模板
    components:{cmpContent},
    data () {
      let dataIndex={
        houseData:[]
      };

      this.$a.get(`http://localhost:8081/api/house/page/1`).then( res=>{
       let json= res.data;
       console.log(res);
       console.log(json.err)
        if(json.err){//从后台设置
          alert('数据库有错');
        }else{

          dataIndex.houseData=json.data;
        }
      },err=>{
        alert('失败了');
        console.error(err);
        console.log(err)
      })
      return dataIndex

    }
  }
</script>